package org.blogwu.learn.designpattern.chapter14.v4;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

public class CourseType extends Course {

    List<Course> courseList = new ArrayList();


    public CourseType(String name) {
        super(name);
    }

    @Override
    public void addCourse(Course course) {
        courseList.add(course);
    }

    @Override
    public void showCourseInfo() {
        System.out.println("当前目录：" + this.name);
        for (Course course : courseList) {
            System.out.print("    ");
            course.showCourseInfo();
        }
    }

    @Override
    public void setPrice(BigDecimal bigDecimal) {
        System.out.println("不支持此操作");
    }
}
